Optimal. Leaf size=41 \[ \frac{a \cos (c+d x)}{d}-\frac{a \cot (c+d x)}{d}-\frac{a \tanh ^{-1}(\cos (c+d x))}{d}-a x \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0550534, antiderivative size = 41, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 6, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.316, Rules used = {2710, 2592, 321, 206, 3473, 8} \[ \frac{a \cos (c+d x)}{d}-\frac{a \cot (c+d x)}{d}-\frac{a \tanh ^{-1}(\cos (c+d x))}{d}-a x \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2710
Rule 2592
Rule 321
Rule 206
Rule 3473
Rule 8
Rubi steps
\begin{align*} \int \cot ^2(c+d x) (a+a \sin (c+d x)) \, dx &=\int \left (a \cos (c+d x) \cot (c+d x)+a \cot ^2(c+d x)\right ) \, dx\\ &=a \int \cos (c+d x) \cot (c+d x) \, dx+a \int \cot ^2(c+d x) \, dx\\ &=-\frac{a \cot (c+d x)}{d}-a \int 1 \, dx-\frac{a \operatorname{Subst}\left (\int \frac{x^2}{1-x^2} \, dx,x,\cos (c+d x)\right )}{d}\\ &=-a x+\frac{a \cos (c+d x)}{d}-\frac{a \cot (c+d x)}{d}-\frac{a \operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\cos (c+d x)\right )}{d}\\ &=-a x-\frac{a \tanh ^{-1}(\cos (c+d x))}{d}+\frac{a \cos (c+d x)}{d}-\frac{a \cot (c+d x)}{d}\\ \end{align*}
Mathematica [C] time = 0.0431169, size = 75, normalized size = 1.83 \[ -\frac{a \cot (c+d x) \, _2F_1\left (-\frac{1}{2},1;\frac{1}{2};-\tan ^2(c+d x)\right )}{d}+\frac{a \cos (c+d x)}{d}+\frac{a \log \left (\sin \left (\frac{1}{2} (c+d x)\right )\right )}{d}-\frac{a \log \left (\cos \left (\frac{1}{2} (c+d x)\right )\right )}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.046, size = 57, normalized size = 1.4 \begin{align*} -ax-{\frac{a\cot \left ( dx+c \right ) }{d}}+{\frac{\cos \left ( dx+c \right ) a}{d}}+{\frac{a\ln \left ( \csc \left ( dx+c \right ) -\cot \left ( dx+c \right ) \right ) }{d}}-{\frac{ca}{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.80564, size = 73, normalized size = 1.78 \begin{align*} -\frac{2 \,{\left (d x + c + \frac{1}{\tan \left (d x + c\right )}\right )} a - a{\left (2 \, \cos \left (d x + c\right ) - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.75282, size = 236, normalized size = 5.76 \begin{align*} -\frac{a \log \left (\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) \sin \left (d x + c\right ) - a \log \left (-\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) \sin \left (d x + c\right ) + 2 \, a \cos \left (d x + c\right ) + 2 \,{\left (a d x - a \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{2 \, d \sin \left (d x + c\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.40176, size = 146, normalized size = 3.56 \begin{align*} -\frac{6 \,{\left (d x + c\right )} a - 6 \, a \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) \right |}\right ) - 3 \, a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + \frac{2 \, a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 3 \, a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 10 \, a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 3 \, a}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )}}{6 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]